package net.flintx.array;

/**
 * Created by flintx on 2018/1/16.
 */
public class OneBitAndTwoBitCharacters {
    public boolean isOneBitCharacter(int[] bits) {
        int index = 0;
        while (index < bits.length) {
            if (bits[index] == 0) {
                index += 1;
            } else if (bits[index] == 1) {
                if (index == bits.length - 2)
                    return false;
                index += 2;
            }
        }
        return true;
    }
}
